package com.zzp.zjs_bos.service.impl;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.zzp.zjs_bos.dao.IDecidedDao;
import com.zzp.zjs_bos.dao.ISubareaDao;
import com.zzp.zjs_bos.domain.Decidedzone;
import com.zzp.zjs_bos.domain.Subarea;
import com.zzp.zjs_bos.service.IDecidedService;
import com.zzp.zjs_bos.utils.PageBean;

@Service
@Transactional
public class DecidedServiceImpl implements IDecidedService {
	
	@Resource
	private IDecidedDao decidedDao;
	
	@Resource
	private ISubareaDao subareaDao;
	
	public void pageQuery(PageBean pageBean) {
		decidedDao.pageQuery(pageBean);
	}

	public void save(Decidedzone model, String[] subareaid) {
		decidedDao.save(model);
		for (String string : subareaid) {
			Subarea subarea = subareaDao.findById(string);
			subarea.setDecidedzone(model);
			
		}
		
	}

}
